// $Id: filemeshbit.h 72 2004-12-02 15:03:28Z jonas $
#ifndef FILEMESHBIT_H
#define FILEMESHBIT_H

#include "filemesh.h"

// TODO: Fine tune these parameters!
const int fileMeshBitCount = 10000;

/**
 * This implementation of the file mesh stores a sequence of bits which can be
 * get and set (internal operations) in order to remember files.
 */
class FileMeshBit : public FileMesh {
public:
	FileMeshBit();
	FileMeshBit(const FileMeshBit &);
	virtual ~FileMeshBit();

	FileMesh *newCopy();
	unsigned int calcDistance(unsigned int);
	void update(unsigned int, std::map<File *, StoredFile *> &);
	void rebuild(std::map<File *, StoredFile *> &);
	//void rebuild(std::list<RoutingEntry> &);

private:
	bool getBit(int);
	void setBit(int, bool);
	int getIndex(int);

	unsigned char *m_bits;
};

#endif
